using System;
using System.Collections.Generic;
using Nuwanda.TfsSpotlight.Shell.Proxies.Interfaces;
using StructureMap;
using StructureMap.Attributes;

namespace Nuwanda.TfsSpotlight.Shell.Services.Interfaces
{
    /// <summary>Provides tabs management services</summary>
    [PluginFamily("TabsService", Scope = InstanceScope.Singleton)]
    public interface ITabsService
    {
        /// <summary>Returns the number of currently opened tabs</summary>
        int TabsCount { get; }

        /// <summary>Checks whether there is a tab that is working</summary>
        bool IsAnyOfTabsWorking { get; }

        /// <summary>Opens given tab and activates it</summary>
        /// <param name="presenter">Presenter of a tab to add</param>
        void OpenTab(ITabPresenter presenter);

        /// <summary>Closes given tab</summary>
        /// <param name="presenter">Presenter of a tab to remove</param>
        void CloseTab(ITabPresenter presenter);

        /// <summary>Gets active tab</summary>
        /// <returns>A presenter of a currently active tab</returns>
        T GetActiveTab<T>();

        /// <summary>Closes all tabs</summary>
        void CloseAllTabs();

        void HandleSelectedTabHanged(ITabPresenter presenter);

        void HandleTabRemoved(ITabPresenter presenter);
        List<ITabPresenter> GetTabs(Func<ITabPresenter, bool> filter);
    }
}